<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var ary = {
        0: "1",
        1: "2",
        2: "3",
        length: 3,
      };
      var ary1 = Array.from(ary, (item) => {
        return item * 2; // 将原来的值全部*2
      }); //方法 转换为数组
      console.log(ary1);
      let arr = {
        0: "长相",
        1: 2,
        2: "zx",
        length: 3,
      };
      let arr1 = Array.from(arr);
      console.log(arr1);
    </script>
  </body>
</html>
